package org.reservation.service.impl;

import java.util.List;

import org.reservation.dao.FoodDAO;
import org.reservation.dao.RestaurantDAO;
import org.reservation.pojo.Food;
import org.reservation.pojo.Restaurant;
import org.reservation.service.ResService;
import org.springframework.orm.hibernate3.HibernateTemplate;

public class ResServiceImpl implements ResService{
	
	private RestaurantDAO resDAO;
	private FoodDAO foodDAO;
	
	public void setResDAO(RestaurantDAO resDAO) {
		this.resDAO = resDAO;
	}

	
	
	public void setFoodDAO(FoodDAO foodDAO) {
		this.foodDAO = foodDAO;
	}



	public void addRes(Restaurant res) {
		// TODO Auto-generated method stub
		resDAO.addRes(res);
	}

	public void deleteResById(int resId) {
		// TODO Auto-generated method stub
		resDAO.deleteRestaurantById(resId);
	}

	public Restaurant getResById(int resId) {
		// TODO Auto-generated method stub
		
		return resDAO.getRestaurantById(resId);
	}

	public List<Food> loadFoodByResId(int resId) {
		// TODO Auto-generated method stub
		return foodDAO.getFoodByRes(resId);
	}

	public List<Restaurant> loadRes() {
		// TODO Auto-generated method stub
		return resDAO.loadRestaurant();
	}

	public void updateResById(Restaurant res) {
		// TODO Auto-generated method stub
		resDAO.updateRestaurant(res);
	}



	public List<Restaurant> loadResBy(int managerId) {
		// TODO Auto-generated method stub
		List<Restaurant> managers=resDAO.loadResBy(managerId);
		return managers;
	}

}
